import {fromJS} from "immutable";
import * as contants from './constants';


// immutable.js ----facebook开发
//先引用 fromJS  将defaultState变成 immutable对象  。调用immutable 的 get set方法
 const defaultState=fromJS({
    title:'',
    content:''
})

export default (state=defaultState,action)=>{
    switch (action.type) {
        case contants.CHANGE_DETAIL:
            return state.merge({
                title:action.title,
                content:action.content
            })
        default:
            return state;
    }
}
